<?php

use admin\widgets\AdminToolbar;
use app\components\BaseGridView;
use app\models\Admin;
?>

<?= AdminToolbar::widget(['search' => FALSE, 'dialog' => TRUE, 'placeholder' => '']); ?>

<?= BaseGridView::widget([
    'dataProvider' => $dataProvider,
    'filterModel' => $searchModel,
    'columns' => [
        'id',
        ['attribute' => 'gid', 'value' => function($model){
            return $model->group->gname;
        }],
        'username',
        'author',
        'email:email',
        'last_login_time:datetime',
        ['attribute' => 'status', 'format' => 'raw', 'value' => function(Admin $model){
            return $model->_statusLabel();
        }],
        [
            'class' => 'app\components\BaseActionColumn',
            'template' => '{save}',
            'saveOptions' => ['class' => 'dialog', 'title' => '修改管理员'],
        ]
    ],
]); ?>
